package ecweb.dao;

import ecweb.dal.DatabaseSession;
import ecweb.domain.AdminUser;
import ecweb.exception.DatabaseException;

public interface IAdminUserDao {

	// SELECT * FROM admin_users WHERE ID = ? LIMIT 0,1
	AdminUser getAdminUserById(DatabaseSession dbses, long id)
			throws DatabaseException;
	
	// SELECT * FROM admin_users WHERE Username = ? LIMIT 0,1
	AdminUser getAdminUserByUsername(DatabaseSession dbses, String username)
			throws DatabaseException;
	
	// SELECT COUNT(*) FROM admin_users WHERE Username = ?
	boolean checkAdminUserExistenceByUsername(DatabaseSession dbses, String username)
			throws DatabaseException;
	
	// UPDATE admin_users SET Password = ? WHERE ID = ?
	boolean updateAdminUserPasswordById(DatabaseSession dbses, AdminUser adminUser)
			throws DatabaseException;
	
	// INSERT INTO admin_users(Username, Password) VALUES (?, ?)
	// SELECT LAST_INSERT_ID()
	void addAdminUser(DatabaseSession dbses, AdminUser adminUser)
			throws DatabaseException;
	
	// DELETE FROM admin_users WHERE ID = ?
	boolean deleteAdminUserById(DatabaseSession dbses, long id)
			throws DatabaseException;
	
}
